package com.ethannhu.todaynews.component.guide

import android.os.Bundle
import android.provider.SyncStateContract.Constants
import com.ethannhu.todaynews.databinding.FragmentGuideBinding
import com.ethannhu.todaynews.fragment.BaseViewModelFragment
import com.ethannhu.todaynews.util.Constant

/**
 * 引导界面 Fragment
 */
class GuideFragment : BaseViewModelFragment<FragmentGuideBinding>() {

    override fun initData() {
        super.initData()
        val data = requireArguments().getInt(Constant.ID)
        binding.icon.setImageResource(data)
    }

    companion object {
        /**
         * fragment推荐的创建方法
         */
        fun newInstance(data: Int): GuideFragment {
            val args = Bundle()
            args.putInt(Constant.ID, data)

            val fragment = GuideFragment()
            fragment.arguments = args
            return fragment
        }
    }

}